# $Id: PKGBUILD 88672 2013-04-21 20:32:15Z jlichtblau $
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Jeff Mickey <jeff@archlinux.org>
# Contributor: Grigorios Bouzakis <grbzks@gmail.com>

pkgname=fdm
pkgver=1.7
pkgrel=1
pkgdesc='Program to fetch and deliver mail'
arch=('i686' 'x86_64')
url='http://fdm.sourceforge.net/'
license=('BSD')
depends=('openssl' 'tdb' 'zlib')
makedepends=('patch' 'sed')
options=('!makeflags')
source=(http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('484474094f124ce438c89dfab05519fe7b3aa8c8346d00f790a512ab950cef2a')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  ./configure
  make PREFIX=/usr MANDIR=/usr/share/man
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  
  make DESTDIR=${pkgdir} PREFIX=/usr MANDIR=/usr/share/man install

  install -d ${pkgdir}/usr/share/{doc,licenses}/${pkgname}
  sed '3,17p;d' fdm.c > ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
  mv examples ${pkgdir}/usr/share/doc/${pkgname}
}
